import requests
import json
# 设置请求的 URL 和请求方法
url = "https://open.bigmodel.cn/api/paas/v3/model-api/{model}/{invoke_method}"
method = "POST"
# 设置请求头
headers = {
   "Content-Type": "application/json",
   "Authorization": "Bearer your_token"
}
# 设置请求体
data = {
   "param1": "value1",
   "param2": "value2"
}
# 发起请求
response = requests.request(method, url, headers=headers, data=json.dumps(data))
# 获取响应内容
content = response.content
# 获取响应状态码
status_code = response.status_code
# 判断请求是否成功
if status_code == 200:
   print("请求成功，响应内容为：", content)
else:
   print(f"请求失败，状态码为：{status_code}")